MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / make

Method make

include/daScript/simulate/aot.h:1940–1952  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1938 template <typename TT, typename AT, bool moveIt = false>
1939 struct das_ascend {
1940 static __forceinline TT * make(Context * __context__,TypeInfo * typeInfo,const AT & init) {
1941 auto size = sizeof(AT)+ (typeInfo ? 16 : 0);
1942 char * ptr = (char *)__context__->allocate(uint32_t(size));
1943 if ( typeInfo ) {
1944 *((TypeInfo **)ptr) = typeInfo;
1945 ptr += 16;
1946 }
1947 memcpy(ptr, &init, sizeof(AT));
1948 if (moveIt) {
1949 memset((char *)&init, 0, sizeof(AT));
1950 }
1951 return (TT *) ptr;
1952 }
1953 };
1954
1955 // escape analysis: the pointee lives in the caller's stack frame (allocate_on_stack), so this

Callers

nothing calls this directly

Calls 1

allocateMethod · 0.45

Tested by

no test coverage detected