mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-09 13:33:39 +00:00
compiler, runtime: add layout parameter to runtime.alloc
This layout parameter is currently always nil and ignored, but will eventually contain a pointer to a memory layout. This commit also adds module verification to the transform tests, as I found out that it didn't (and therefore didn't initially catch all bugs).
This commit is contained in:
committed by
Ron Evans
parent
c454568688
commit
f24a93c51d
@@ -729,7 +729,7 @@ func Zero(typ Type) Value {
|
||||
func New(typ Type) Value {
|
||||
return Value{
|
||||
typecode: PtrTo(typ).(rawType),
|
||||
value: alloc(typ.Size()),
|
||||
value: alloc(typ.Size(), nil),
|
||||
flags: valueFlagExported,
|
||||
}
|
||||
}
|
||||
@@ -778,7 +778,7 @@ func (e *ValueError) Error() string {
|
||||
func memcpy(dst, src unsafe.Pointer, size uintptr)
|
||||
|
||||
//go:linkname alloc runtime.alloc
|
||||
func alloc(size uintptr) unsafe.Pointer
|
||||
func alloc(size uintptr, layout unsafe.Pointer) unsafe.Pointer
|
||||
|
||||
//go:linkname sliceAppend runtime.sliceAppend
|
||||
func sliceAppend(srcBuf, elemsBuf unsafe.Pointer, srcLen, srcCap, elemsLen uintptr, elemSize uintptr) (unsafe.Pointer, uintptr, uintptr)
|
||||
|
||||
Reference in New Issue
Block a user