Skip to content

Instantly share code, notes, and snippets.

@tmarplatt
Created April 18, 2018 09:36
Show Gist options
  • Save tmarplatt/29c7025e42784c2c539d45bfcfaac5c7 to your computer and use it in GitHub Desktop.
Save tmarplatt/29c7025e42784c2c539d45bfcfaac5c7 to your computer and use it in GitHub Desktop.
pyd GC test
import dTests
from kivy.uix.widget import Widget
class testClass(Widget):
one = [1, 2, 3, 4, 5, 6]
widgetlist = []
for x in range(100000):
a = testClass()
widgetlist += [ a ]
for x in range(100000):
dTests.iterateOverWidgets(widgetlist)
from pyd.support import setup, Extension
projectName = 'dTests'
compileArgs = ['-w']
setup(
name=projectName,
version='0.0.1',
ext_modules=[
Extension(projectName, ['tests.d'],
extra_compile_args=compileArgs,
build_deimos=True,
d_lump=True
)
],
)
module dTests;
import pyd.pyd;
struct testPO {
PydObject po;
}
void iterateOverWidgets(PydObject a) {
testPO current;
foreach (widget; a) {
current = testPO(widget);
}
}
extern(C) void PydMain() {
def!(iterateOverWidgets)();
module_init();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment