Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
2
Task/Memory-allocation/Axe/memory-allocation.axe
Normal file
2
Task/Memory-allocation/Axe/memory-allocation.axe
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Buff(100)→Str1
|
||||
.Str1 points to a 100-byte memory region allocated at compile time
|
||||
6
Task/Memory-allocation/Lingo/memory-allocation.lingo
Normal file
6
Task/Memory-allocation/Lingo/memory-allocation.lingo
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
-- Create a ByteArray of 100 Kb (pre-filled with 0 bytes)
|
||||
ba = byteArray(102400)
|
||||
|
||||
-- Lingo uses garbage-collection, so allocated memory is released when no more references exist.
|
||||
-- For the above variable ba, this can be achieved by calling:
|
||||
ba = VOID
|
||||
7
Task/Memory-allocation/Nim/memory-allocation.nim
Normal file
7
Task/Memory-allocation/Nim/memory-allocation.nim
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Allocate thread local heap memory
|
||||
var a = alloc(1000)
|
||||
dealloc(a)
|
||||
|
||||
# Allocate memory block on shared heap
|
||||
var b = allocShared(1000)
|
||||
deallocShared(b)
|
||||
5
Task/Memory-allocation/Phix/memory-allocation.phix
Normal file
5
Task/Memory-allocation/Phix/memory-allocation.phix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
atom addr = allocate(512) -- limit is 1,610,612,728 bytes on 32-bit systems
|
||||
...
|
||||
free(addr)
|
||||
atom addr2 = allocate(512,1) -- automatically freed when addr2 drops out of scope or re-assigned
|
||||
atom addr3 = allocate_string("a string",1) -- automatically freed when addr3 drops out of scope or re-assigned
|
||||
2
Task/Memory-allocation/Ring/memory-allocation.ring
Normal file
2
Task/Memory-allocation/Ring/memory-allocation.ring
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
cVar = " " # create variable contains string of 5 bytes
|
||||
cVar = NULL # destroy the 5 bytes string !
|
||||
Loading…
Add table
Add a link
Reference in a new issue