A destructor is a method in Object Oriented Programming that allows the programmer to clean up their mess before they abandon an object.

Yeah, but why would anyone want to do that?

During the life of an object, it may allocate memory, create pointers, references, linked lists, or other constructs which eat memory. Sometimes when you're done with an object and you don't have an adequate destructor, these resources will still be reserved by your program, and therefore not available to other processes. Even your program can't re-grab them. Since your program can no longer use them, and they're off-limits to other programs, these resources are in limbo and are rendered useless. This is called a memory leak.

Memory leaks are generally considered bad juju in programming circles.

In Java there are no explicit destructors, because of the garbage collector, which eliminates the need for the programmer to manually clean up the mess. When the commode is flushed on your object, as it were, the garbage collector wipes your bum for you, blows your nose and offers you a mint. Any resources your program has snarfed up are released back to the heap. All this is done without the knowledge or consent of the programmer.

In Visual Basic there is a combination of manual and automatic destruction. You can't deallocate anything (because you were never allowed to allocate it in the first place), but you can handle any last minute details before your object bites the dust. And if your object was holding any resources, they are dropped before the object is destroyed. This is done through your class's Terminate Function.

In C++, you had better keep track of anything that may need to be released, because there is no garbage collector whatsoever. You're on your own. The destructor is indicated by a bitwise complement operator (~) followed by the constructor's name (get it?). So if your constructor was called "MyObject()", the destructor would be called "~MyObject()".


Addendum Oct. 30, 2002: ariels has just reminded me that destructors are not only for deallocating memory. He gives me the for instance: "the fstream destructor closes the file -- it releases a file descriptor (and, if based on libc, also a file pointer)."

Basically the destructor is for any cleanup operation. I, personally, use it most often for deallocating memory, releasing pointers, and when using sockets, calling the WSACleanup routine.

« Why Not Just | Ra

Forty-six decillion joules is horrific overkill, commensurate with the urgency of Virtual civilisation's combined desire for more processing power. The energy packet distorts spacetime as it travels, and when the Earth's core node catches it, the planet measurably increases in mass and widens in orbit.

Vivid red lasers unzip the planet from top to bottom, slicing it along criss-crossing spiral rhumb lines. The lasers are powerful enough to be visible to the naked eye from Pluto; with good telescopy, the light show can be seen from other star systems. One beam even plays across the Moon's face before the dicing procedure is over, scorching it mildly.

The lasers represent the smaller share of the energy. Far more is spent to physically lift the jigsaw pieces of the first crust layer into the sky, hoisting significant amounts of sky with it. The planet unfurls like an onion over the course of an hour, individual shreds of country and rainforest unfolding themselves into thinner shreds still, absorbing further sunlight and reconstituting themselves into first-stage hosting substrate. Kicked with useful pulses of momentum from the coordinating core, the shreds radiate away into free space and align themselves against the solar wind, effecting an orbital change which will bring them nearer to the Sun, where energy is more plentiful. That takes care of the first layer, including all remaining physical traces of human civilisation. That was us. That was home.

A raw, molten second layer of Earth is exposed, where the process cycles around and starts again with the lasers. It's the rush job from hell, with unimaginable resource expenditure behind it; taking the whole planet apart will only take ten hours. Newly-awakened Virtualities are already colonising the remains, like maggots laid in roadkill. Within another thousand hours, the remains are ground entirely into a film of computronic sludge, wrapping the Sun tightly and harvesting almost all of its energy for processing power. The Sun dims as it happens, its spectrum shifting out of the visible and far into the infrared.

Adam King watches the synthesised edition of the recording, coverage assembled by passive observation platforms in the Oort Cloud. From this perspective, with false colour and no audio, the demolition is chillingly distant and its impact is hard to feel.

King is inside a very small, extremely temporary virtual space inside an otherwise inert starship the size and shape of a javelin, almost three light years from Earth in the direction of Sirius. This is the destination that the Wheel Group evacuated to. It was the only open receiver anywhere in extrasolar space.

The ship left Earth for Sirius very shortly after Abstract War. The back half of the ship is data, the front half is the terraformer. It's hardly much more than a single bootstrap, a chunk of machinery which serves no purpose but to assemble other chunks of machinery. The ship has been travelling for more than thirty years, and will not arrive at its destination for another sixty. There is a planet at Sirius A, in the Goldilocks zone. It doesn't have water, yet.

King's virtuality is the size of an elevator car, with only a small table, a folding metal chair and a portable CRT television. There is only one other person physically present with him, the arbiter, who stands behind him watching him watch the replay. But everybody is sharing her eyes. There are well over a hundred stored people on board, survivors of the war, mostly survivors of the Triton mission. Calling them Wheel Group members would be strictly inaccurate, they having left the world before the Wheel was formed. Reasons for leaving vary-- some thought the Sol system was a lost cause, or that abandoning the ruined Earth was moral and necessary, or just had a powerful desire to flee into the dark; some despised King and his vision, and couldn't muster the support to shout him down. The unifying thought among them, back then, was disapproval. Now it's horror. King is not among friends.

He fidgets in the deliberately uncomfortable chair, trying to find room for his legs, and/or some way to dodge the arbiter's stare.

"And you survive," the arbiter concludes. "Out of six billion, two hundred and seventy-five million, four hundred thousand people, you survive. You, and your Group, and nobody else. A crowning achievement of cowardice."

King begins, "It was impossible to save anybody else, we didn't have the broadcast power--"

"You lost your mind in the War." The arbiter's tone of voice is calculatedly neutral and impossible to speak over. "You, together with everybody who fell in with you. After such unimaginable chaos, you were desperate for a world where there would be a manageable order. You turned the Earth into a facsimile of a working planet. A romance. You dragged billions of people into existence and you let them raise children as if it was real. In a world which they basically believed that they understood, and which they basically believed to be rational and safe.

"We find 'magic' to be absurd. We find the 'Earth' you built to be an obscenity. You could have built an entirely new world, or left the planet uninhabitable as it was, as an honest memorial. Even oblivion would have been preferable. We left the world rather than stay and be complicit in your madness. We set out for an entirely other star system, knowing it would take decades to get there. You should see what we're going to build. Any of you could have come with us and seen it, if you'd chosen to.

"And in the end your 'Earth' was illusory, and all of this amounts to a delayed action. Three decades later, Virtual humanity takes the Sol system anyway; Ra remains 'radioactive' for ten billion years."

King clenches his fist at the series of accusations. They're intolerable, and he could find the words to fight any or all of them, but where would be the point? This isn't the trial anymore. The decision is already made, and all of this is just infodump; the minimum necessary courtesy.

"You're relieved," King says. "All of you. You're glad it's finally over. You're glad that you get to say you made the right decision to leave, and that I made the wrong decision to stay and rebuild. The world I built worked."

The arbiter ignores this. "Adam King, we deny your Group's request for asylum. Your patterns will be stored indefinitely, or until a more lenient future generation pardons you."

*

Rachel Ferno doesn't need yammering voices for the rest of this. "Save everybody except me," she stage-whispers into the Bridge. Five white snaps of light mark the departure of Nick Laughon, Edward Hatt, Anil Devi and Laura and Natalie Ferno. Of them, only Devi is paying close enough attention to the proceedings to react to the instruction. He shows a fraction of a second of surprise, but doesn't have time to process what's happening before it's done. Hatt, Laura and Natalie simply don't react. Nick Laughon, for his part, was already turning away from the Ferno story, a story he no longer wanted to be part of, one which he felt an urgent need to exit.

Rachel is standing too far from civilisation to see everybody else being uploaded, but she imagines she can feel the world emptying and the Bridge filling up. The wave of white events spreads at close to the speed of light, taking people from their beds and from behind the wheels of cars and from aeroplanes in flight. These are destructive reads. In one second, all the important people on Earth - which is to say, all the people - are missing from it, converted to information and archived in the Bridge's capacious buffer. That leaves Rachel alone on a ghost world. She snaps a shot of the world's crust, for good measure. Animals and buildings, mainly, the lower priorities.

She takes one step and is immediately at the Wheel Group penthouse in New York city, where it's the small hours of the morning. In the streets outside the enormous bay window, vehicles are still rolling to a halt after the rapture.

Rachel was excommunicated from the Wheel Group, or left it, or never joined it, depending on how you slice the sequence of events, but she retains one or two privileges. She retains enough status for the penthouse system to dutifully inform her that the whole Wheel, Adam King included, has been beamed straight out of the Sol system. The evacuation procedure is already complete, which is why the sky has cleared of warnings and the penthouse is standing empty like the rest of the world.

Rachel is further informed that the Wheel Group burned through almost all of the energy in the Earth core cache to do this. Approximately zero point eight three percent per member, for maximum clarity and signal intensity in the nonlocal "radio" transmission. Magic still works, but the world is running on fumes now. Much, much more energy is coming down the downlink, of course, but by that point it'll be all too late. There is, perhaps, enough remaining mana on the whole planet to beam a single additional human being to safety, and there's no other way to get there-- the practical range of site-to-site teleportation using the Bridge is only a few thousand kilometres.

One person. Rachel spends a dangerous amount of time seriously contemplating this prospect. She could drop the Bridge where she's standing and send herself. That'd be easy. It would, in fact, be the simplest thing in the world.

She could send either of her children. Not both.

She could send her husband.

Rachel is in the penthouse dining room, with the bay window as big as a tennis court. She kicks it out, scattering plate glass into the East River, and looks up. It's November, and the city is overcast. The air is freezing and there is even a flake or two of snow, which come to rest on her hair. The star, Sirius, is up there somewhere, but all Rachel sees is the underside of thick grey cloud. The ship, she knows, is three light years away in that direction. That's closer than any star, but still a staggering distance to transmit a clear signal. And a human being represents a staggering amount of signal to transmit.

She asks the penthouse system, if all possible compression was used and all the margins of safety were entirely ignored, how many people she could really save. The penthouse replies, one.

The honest, honourable, heroic thing to do would be to pick a human being totally at random, from everybody saved inside the Bridge.

And after that one dangerous moment Rachel discards the entire option as a red herring. It's a waste of drama. She clearly needs more power.

Another step, and Rachel is ten hours east and forty degrees south, on a minuscule, unspoilt spit of white sand in the Maldives. This places her in broad daylight, almost directly underneath the adversary, looking straight up at the incoming energy.

She could intercept part of it. Just the tiniest, tiniest skimmed sliver would be more than she needs. She could rise up and meet the packet in space, build a makeshift soft receiver out of pure fields, a receiver which would probably overload and explode at the instant it met what was coming, and then she could leech what she needed from the detonation. Or she could teleport one of the eight receiver nodes right out of the Earth's core, repurpose it with advanced-level Wheel Group privilege escalation hackery, and execute an outright heist of the first subpacket. Six Sol-months of energy, in a steel boule the size of Monaco.

But the plans fizzle away. The Bridge would be disabled before any of that worked, Rachel knows, because Ra wants all of that energy. Ra would put her back on the ground, helpless. It would steal the stolen node back again, it would purée her medulla oblongata. It would plant fearful and uncertain thoughts in her head, making it so she wouldn't even want to try.

Because you can't fight Ra, can you? You can't fight God unless God wants you to. You can't even entertain the thought of it.

So it's plan C, which is close to impossible. Part of her is already laying the framework out and that's the bottom line: close to impossible.

Rachel accepts the estimate and dismisses the rest, compartmentalising the doubts and the intimidation. She will have abundant time to reflect on doing the near-impossible after it's done. The same goes for final words. It seems they've already been spoken.

After all that, it feels strange to be allowed to get away clean, to represent such a non-threat as to be ignorable. But all the client strictly asked for was a Matrioshka brain. Just one.

*

Laura wakes up with a start, in complete darkness, without any senses. She feels like a bare, numb thought centre, as if someone amputated her entire body.

"Mum?" she tries. She can't feel her jaw or tongue moving. She can't hear herself speaking. She can't breathe, and she can't feel the urgent pressure of needing to breathe either. She should be choking, or hyperventilating. Maybe she is, and can't tell. "Mum!"

She could be dead. She's died four times, that she knows of. Surely, sooner or later, that would qualify her to see what's on the other side? Except that afterlives are generally more inventive.

There's a blast of maniacal pink noise, loud enough that Laura knows it should be painful, but it isn't, it just redlines her hearing for a while and then cuts out. "There we go," she hears her mother say.

"What did you do?"

"Just relax."

"This feels horrible--"

"No," Rachel explains patiently. "It doesn't feel like anything at all. Listen to your absence of body, and think about it. And relax."

Laura gulps. Doesn't gulp. She feels like... nothing. "What happened?"

"I built a starship," Rachel says. "I uploaded the entire human race into the Bridge, and then built a starship out of magic. Right now, you're a disembodied mindstate connected to an old-fashioned speaking tube, and out here in reality it's just me. And the MacGuffin with all its radiation plating. And a metre-thick abrasion shield made of magic. In case of dust specks."

"We're in space?"

"That was about ninety days ago," Rachel continues. "And that's 'days' in inverted commas, it's just one undifferentiated SI second after the other out here. Stunningly beautiful, of course. Absolutely spectacular, nothing but fixed stars and mind-numbing vertigo in every direction."

"You built a starship," Laura repeats. "Not just a spaceship, a starship. Out of pure magic. And got it far enough out of Earth's gravity well to survive the demolition. In eleven minutes?"

Rachel assumes her daughter is speaking rhetorically, and says nothing. It's all true, though.

"Sneakernet," Laura says. "There wasn't enough bandwidth for a transmission, so you decided to carry the whole world to the next star. On foot."

Again, nothing. Rachel spins lazily in freefall, taking a long look at the brightest star ahead of her, then the Milky Way, then at the dull and still dimming orange spot directly behind.

Laura asks, "Where are we going?"

"Laura, listen."

"The same place as the Wheel Group, right? There must be something out there--"

"I spoke to Natalie," Rachel says.

"About what?"

"And I spoke to Nick as well."

"You don't even know Nick."

"Now I do. And Anil Devi, and Edward Hatt, and a long list of other people. I've had ample time. I have the full story."

Laura has a sinking feeling. She asks, softly, "What is this?"

"Ra lied to you," Rachel says. "Wearing Nick's face, a face which you loved and trusted, Ra took you into a lecture theatre and showed you on a blackboard that you were the most important person in the universe. Ra told you that world order was faulty, which is always true, and that the whole thing could be made perfect in a moment if you only did what he told you, which never is. And you bought it, wholesale. You let them turn you into a... a chess piece, because they promised you'd be one of the powerful ones.

"I understand everything else about you. The lust for space; the need to acquire enough power to clear the bar I set up for you and the need for me to be alive and watching while you did it; the semi-legitimate, semi-legitimising need to fix the world and put Wheel Group hypertechnology in the hands of 'the people'. None of it excuses you, Laura, I want you to understand this, you're guilty as hell and one day you're going to be made to answer for it. But: the hero story. How could you fall for it? The mythology, I mean. That one obvious, colossal lie."

Laura says nothing for a full, stunned minute.

"Because for fourteen years you raised Nat and me inside a colossal lie. You were the liar. You brought us up telling us 'This is the way the world works', and then one day you shrugged all of that off and rolled out wizardry from a whole, impossible, unseen Age of Magic. And then you killed yourself, leaving what behind? What was I supposed to do with my life after that? What was I supposed to believe?"

"I didn't have a choice."

"Yes! You did!"

"When someone is dying in front of you and you can save them, you have to save them," Rachel avers. "There is no decision-making process, because there is no decision."

"So you admit it. You weren't even thinking about what you were doing to us," Laura says.

"I'm saying that thinking about it would have wasted seconds that the astronauts couldn't afford. And after those seconds, I'd still have done it, because there's no justifying letting people die in front of you. I'm sorry. I said I was sorry. I would do it again."

"So would I," Laura says levelly. "All of it. It was worth it."

"So you believed the lie because you wanted to," Rachel surmises. "You wanted to believe you were special."

"I..." - Laura watches her language, then thinks again - "fucking am."

Rachel shuts her down.

*

There must be something out there.

Rachel floats in the centre of the ship, foetal. If she stretches out like Vitruvian Man, she can touch the inner edge of the shield with her fingers and toes. The spherical interior is coincidentally airtight, but she lost all the captured Earth air less than a week into the voyage, when her shield malfunctioned for the first time. Since then, she's been breathing vacuum. The Wheel Group medring replaces life support, including air, water, food, heat and all other bodily necessities.

The MacGuffin floats beside her, still wired into her mind. Nothing is lost. Only frozen. It can be brought back.

She has no propulsion. She used most of the available energy to get up to speed, piping it all into a hurriedly improvised disposable relativistic booster rocket, essentially a machine to turn mana into kinetic energy with significant embellishments to cope with the apocalyptic throughput, which saw her acceleration peaking at more than a hundred gees. By the time the first lasers were firing, she was so far from Earth that their odds of clipping her were negligible.

Magic, of course, is provided by secretive listener bugs still soaking Rachel's skin and clothes. Magic, the system, is not reliant on nodes, caches or direct energy delivery from Ra itself. Magic continues to function, providing indirect access to otherwise inaccessible nonlocality technology, for as long as there is energy to power the metaphor.

Rachel inspects the readout which tells her how long it's going to take her to reach Sirius. Since days and years don't exist anymore, it gives her a number of seconds. It is a number comfortably into eleven digits. Several centuries, but again, centuries don't exist anymore. She will spend most of the journey asleep, waking only for emergencies and decennial systems checks.

The javelin is far ahead of her and moving far faster. The colonists will have plenty of time to get comfortable. There will be something at Sirius by the time she gets there. Maybe. It'll be friendly, maybe. And if not, she can keep improvising.

 

The End

« Why Not Just | Ra

De*struc"tor (?), n. [L., from destruere. See Destroy, and cf. Destroyer.]

A destroyer. [R.]

Fire, the destructor and the artificial death of things.
Boyle.

 

© Webster 1913


De*struct"or, n.

A furnace or oven for the burning or carbonizing of refuse; specif. (Sewage Disposal),

a furnace (called in full refuse destructor) in which the more solid constituents of sewage are burnt. Destructors are often so constructed as to utilize refuse as fuel.

 

© Webster 1913

Log in or register to write something here or to contact authors.