{"action":"created","issue":{"url":"https://api.github.com/repos/rap2363/huffmancoding/issues/4","labels_url":"https://api.github.com/repos/rap2363/huffmancoding/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/rap2363/huffmancoding/issues/4/comments","events_url":"https://api.github.com/repos/rap2363/huffmancoding/issues/4/events","html_url":"https://github.com/rap2363/huffmancoding/issues/4","id":99872438,"number":4,"title":"Memory Allocation in Binary Encoder","user":{"login":"rap2363","id":3723199,"avatar_url":"https://avatars.githubusercontent.com/u/3723199?v=3","gravatar_id":"","url":"https://api.github.com/users/rap2363","html_url":"https://github.com/rap2363","followers_url":"https://api.github.com/users/rap2363/followers","following_url":"https://api.github.com/users/rap2363/following{/other_user}","gists_url":"https://api.github.com/users/rap2363/gists{/gist_id}","starred_url":"https://api.github.com/users/rap2363/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rap2363/subscriptions","organizations_url":"https://api.github.com/users/rap2363/orgs","repos_url":"https://api.github.com/users/rap2363/repos","events_url":"https://api.github.com/users/rap2363/events{/privacy}","received_events_url":"https://api.github.com/users/rap2363/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-09T07:36:50Z","updated_at":"2015-08-13T07:08:55Z","closed_at":"2015-08-13T07:08:55Z","body":"Currently we allocate a ton of memory for the BinaryEncoder object.\r\n\r\nIt has 4 interface methods:\r\nstreamCharacterFileIn (reads in a text files and stores the bits as bools).\r\nstreamBinaryFileOut (streams out the currently held bits).\r\nstreamBinaryFileIn (streams in bits from a bin file and stores the bits as bools).\r\nstreamCharacterFileOut (streams out stored bits into a character file).\r\n\r\nLogistically, streamCharacterFileIn and streamBinaryFileOut are called directly with each other in compress.cpp, and the same is true for the latter two methods in decompress.cpp. From an efficiency standpoint, we don't need to actually store any bits in the BinaryEncoder. It could just read from one file, and write to another (using a previously allocated character buffer in between). Storing the bits as bools however would require 8x more memory as bools are stored as bytes anyway!\r\n"},"comment":{"url":"https://api.github.com/repos/rap2363/huffmancoding/issues/comments/130560651","html_url":"https://github.com/rap2363/huffmancoding/issues/4#issuecomment-130560651","issue_url":"https://api.github.com/repos/rap2363/huffmancoding/issues/4","id":130560651,"user":{"login":"rap2363","id":3723199,"avatar_url":"https://avatars.githubusercontent.com/u/3723199?v=3","gravatar_id":"","url":"https://api.github.com/users/rap2363","html_url":"https://github.com/rap2363","followers_url":"https://api.github.com/users/rap2363/followers","following_url":"https://api.github.com/users/rap2363/following{/other_user}","gists_url":"https://api.github.com/users/rap2363/gists{/gist_id}","starred_url":"https://api.github.com/users/rap2363/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rap2363/subscriptions","organizations_url":"https://api.github.com/users/rap2363/orgs","repos_url":"https://api.github.com/users/rap2363/repos","events_url":"https://api.github.com/users/rap2363/events{/privacy}","received_events_url":"https://api.github.com/users/rap2363/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T07:08:55Z","updated_at":"2015-08-13T07:08:55Z","body":"Decompression has been patched as well. Closing this issue."}}