Skip to main content

Featured

Build docker image from multiple build contexts

Build docker image from multiple build contexts Building a docker image requires specifying a source of truth to include in the image from a local directory or a remote git repository. In the previous version, the docker BuildKit allows users to specify the build context from a single source of truth only. However, the engineers may need to have the context from different locations based on the type of files. For instance, icons, images or other resources that are not included in the same package, including the resource from other docker images. Fortunately, the Docker Buildx toolkit supports multiple build context flag for Docker 1.4. Let's learn how to use this new feature. The following list is a shortcut for jumping into a specific topic handy. What version of Docker is this tutorial targeting? How to specify the version of Dockerfile frontend? Ho

[Win]_msize()使用注意

在windows底下,對於使用mallocate出來的記憶體區塊,無法使用sizeof()來取得實際的buffer size。
因為sizeof()取得到的是pointer的size。

因此有一個_msize()的函式可以針對mallocate出來的記憶體區塊來取得其空間位置。

目前使用時,_msize()除了可使用於mallcate的記憶體區塊,也可以使用在以char szbuf[]方式產生的記憶體區塊。

目前測試在大部分的XP 32/x64, Vista x64, Win7 x64, server 2008 x64都可正常運行。
但目前發現在某些Win7 x64底下會發生crash事件,原因目前不明。

所以如有需要知道用 char[]宣告方式之buffer size,還是使用sizeof()比較安全。
_msize()還是盡量用在malloc()產生的記憶體區塊。

Comments

Popular Posts